package com.taobao.snowsnow.hibernate.pojo;

import java.util.ArrayList;
import java.util.List;

public class Color {

	private Integer id;
	private String name;
	private String rgb;
	private String code;
	private String descs;
	
	private List<ItemCollect> itemCollect = new ArrayList<ItemCollect>();

	public Color() {
	}

	public Color(String name, String rgb, String code, String descs) {
		super();
		this.name = name;
		this.rgb = rgb;
		this.code = code;
		this.descs = descs;
	}

	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getRgb() {
		return this.rgb;
	}

	public void setRgb(String rgb) {
		this.rgb = rgb;
	}

	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getDescs() {
		return this.descs;
	}

	public void setDescs(String descs) {
		this.descs = descs;
	}

	@Override
	public String toString() {
		return "Color [id=" + id + ", name=" + name + ", rgb=" + rgb
				+ ", code=" + code + ", descs=" + descs + "]";
	}

	public List<ItemCollect> getItemCollect() {
		return itemCollect;
	}

	public void setItemCollect(List<ItemCollect> itemCollect) {
		this.itemCollect = itemCollect;
	}
	
	@Override
	public boolean equals(Object obj) {
		Color o = (Color) obj;
		
		if(o.getId() != null) {
			if(o.getId() == this.id)
				return true;
		}
		
		if(o.getName().equals(this.name))
			return true;
		
		return false;
	}
}